package com.samehope.ar.controller;


import com.samehope.ar.common.CommonResult;
import com.samehope.ar.service.ISysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 角色 前端控制器
 * </p>
 *
 * @author Zhang Luo
 * @since 2019-12-23
 */
@RestController
@RequestMapping("/role")
public class SysRoleController {

    @Autowired
    private ISysRoleService roleService;

    /**
     * 管理员角色
     * @return
     */
    @PreAuthorize("hasRole('PROJECT')")
    @GetMapping("/manageRoles")
    public CommonResult getManageRoles() {
        return CommonResult.success(roleService.getManageRoles());
    }

}
